package com.qf.controller;

import com.qf.feign.CacheService;
import com.qianfeng.smsplatform.common.constants.CacheConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;

/*
 * @Data: 2021/7/17 14:42
 * */
@RestController
@RequestMapping("/filter")
public class FilterController {
    private CacheService cacheService;
    @Autowired
    public void setCacheService(CacheService cacheService) {
        this.cacheService = cacheService;
    }

    @GetMapping("/add")
    public String addFilter(@RequestParam("strategy") String... strategy){

        System.out.println("jinx");
        cacheService.add2Set(CacheConstants.CACHE_FILTER_KEY, Arrays.asList(strategy));
        return "OK";
    }

}
